<?php

/**
 * Form Value Override
 *
 * Grabs a value from the POST or GET array for the specified field so you can
 * re-populate an input field or textarea.  If Form Validation
 * is active it retrieves the info from the validation class
 *
 * @access	public
 * @param	string
 * @return	mixed
 */

function set_value($field = '', $default = '') {

    if (FALSE === ($OBJ = & _get_validation_object())) {
        if (isset($_POST[$field])) {
            return form_prep($_POST[$field], $field);
        }
        if (isset($_GET[$field])) {
            return form_prep($_GET[$field], $field);
        }
        return $default;
    }

    return form_prep($OBJ->set_value($field, $default), $field);
}

?>
